// pages/manage/doctor/doctorIndex.js
const app = getApp();
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    inquiryIconList: [{
      icon: 'cardboardfill',
      color: 'green',
      badge: 120,
      name: '当前问诊'
    }, {
      icon: 'recordfill',
      color: 'green',
      badge: 1,
      name: '历史问诊'
    }, {
      icon: 'picfill',
      color: 'green',
      badge: 0,
      name: '问诊评价'
    }],

    patientIconList: [{
      icon: 'like',
      color: 'orange',
      badge: 120,
      name: '患者分类'
    }, {
      icon: 'remind',
      color: 'orange',
      badge: 1,
      name: '单点沟通'
    }, {
      icon: 'link',
      color: 'orange',
      badge: 0,
      name: '多点推送'
    }],

    earningsIconList: [{
      icon: 'recharge',
      color: 'red',
      badge: 120,
      name: '问诊收益'
    }, {
      icon: 'refund',
      color: 'red',
      badge: 1,
      name: '平台返利'
    }],

    doctorIconList: [{
      icon: 'goods',
      color: 'yellow',
      badge: 120,
      name: '线下日程'
    }, {
      icon: 'activity',
      color: 'yellow',
      badge: 1,
      name: '线上日程'
    }, {
      icon: 'profile',
      color: 'yellow',
      badge: 1,
      name: '个人信息'
    }],

    gridCol:3,
    skin: false
  },




  showModal(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target
    })
  },
  hideModal(e) {
    this.setData({
      modalName: null
    })
  },
  gridchange: function (e) {
    this.setData({
      gridCol: e.detail.value
    });
  },
  gridswitch: function (e) {
    this.setData({
      gridBorder: e.detail.value
    });
  },
  menuBorder: function (e) {
    this.setData({
      menuBorder: e.detail.value
    });
  },
  menuArrow: function (e) {
    this.setData({
      menuArrow: e.detail.value
    });
  },
  menuCard: function (e) {
    this.setData({
      menuCard: e.detail.value
    });
  },
  switchSex: function (e) {
    this.setData({
      skin: e.detail.value
    });
  },

  // ListTouch触摸开始
  ListTouchStart(e) {
    this.setData({
      ListTouchStart: e.touches[0].pageX
    })
  },

  // ListTouch计算方向
  ListTouchMove(e) {
    this.setData({
      ListTouchDirection: e.touches[0].pageX - this.data.ListTouchStart > 0 ? 'right' : 'left'
    })
  },

  // ListTouch计算滚动
  ListTouchEnd(e) {
    if (this.data.ListTouchDirection =='left'){
      this.setData({
        modalName: e.currentTarget.dataset.target
      })
    } else {
      this.setData({
        modalName: null
      })
    }
    this.setData({
      ListTouchDirection: null
    })
  },
})